home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
e
/
AEPD09.lha
/
EPD09
/
Amiga_E-Programme
/
ESEE
/
GoldED
/
ARexx
/
CompileE.ged
next >
Wrap
Text File
|
1994-08-18
|
3KB
|
115 lines
/* $VER: CompileE.ged v0.9 (16-Sep-93) © 1993 by Leon Woestenberg
*/
/* Set E Compiler pathname here */
ec = 'ec:ec >T:Eerror'
options results
signal on error
if (left(address(), 6) ~= "GOLDED") then address 'GOLDED.1'
'LOCK CURRENT QUIET'
if rc then do
exit
end
'QUERY ANYTEXT'
if (result='TRUE') then
do /* there is text */
'QUERY DOC'
'QUERY DOC VAR FILEPATH'
if (upper(right(result,2)) ~= '.E') then do
'REQUEST TITLE="AmigaE Compiler Request" BODY="AmigaE sources must have extension ''.e''"'
'UNLOCK'
exit
end
'QUERY MODIFY'
if (result='TRUE') then 'SAVE ALL'
nosuffix = LEFT(FILEPATH,LENGTH(FILEPATH)-2)
address command ec nosuffix
end
else
do /* there is no text */
end
'UNLOCK'
exit
/* Parse error, show it, and exit */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
error:
ok = open(filehandler,'T:Eerror','Read')
if ok = 0 then
do
'REQUEST TITLE="AmigaE Compiler Script Error" BODY="Could not read E Compiler error output"'
end
else
do
linestring=''
withstring=''
errorstring=''
errortext=''
dummy = readln(filehandler)
DO WHILE ~EOF(filehandler)
line = readln(filehandler)
/* index does the trick :o) */
/* ~~~~~~~~~~~~~~~~~~~~~~~~ */
SELECT
WHEN INDEX(line,'ERROR:')~=0 THEN
DO
parse var line dummy ': ' errorstring
errorstring=strip(errorstring)
parse var errorstring left '"' right
do while (right ~= '')
errorstring = left || '`' || right
parse var errorstring left '"' right
end
END
WHEN FIND(line,'WITH:')~=0 THEN
DO
parse var line dummy ': ' withstring
withstring=strip(withstring)
parse var withstring left '"' right
do while (right ~= '')
errorstring = left || '`' || right
parse var errorstring left '"' right
end
END
WHEN FIND(line,'LINE ')~=0 THEN
DO
parse var line nodummy ': ' linestring
parse var nodummy dummy 'LINE ' errorline
linestring=strip(linestring)
parse var linestring left '"' right
do while (right ~= '')
errorstring = left || '''' || right
parse var errorstring left '"' right
end
END
OTHERWISE
NOP
END
END
errortext='Line '||errorline
if linestring ~= '' then do
errortext = errortext||': '||linestring
end
if errorstring ~= '' then do
errortext = errortext||'|'||'Error: '||errorstring
end
if withstring ~= '' then do
errortext = errortext||'|'||'With : '||withstring
end
'GOTO LINE='||errorline
'REQUEST BODY="' || errortext || '"'
end
ok = close(filehandler)
'UNLOCK'
exit